// LogView.cpp : implementation file
//

#include "stdafx.h"
#include "Bloodlead.h"
#include "LogView.h"


// CLogView

IMPLEMENT_DYNCREATE(CLogView, CEditView)

CLogView::CLogView()
{

}

CLogView::~CLogView()
{
}

BEGIN_MESSAGE_MAP(CLogView, CEditView)
	ON_WM_DESTROY()
END_MESSAGE_MAP()


// CLogView diagnostics

#ifdef _DEBUG
void CLogView::AssertValid() const
{
	CEditView::AssertValid();
}

#ifndef _WIN32_WCE
void CLogView::Dump(CDumpContext& dc) const
{
	CEditView::Dump(dc);
}
#endif
#endif //_DEBUG


// CLogView message handlers

void CLogView::OnInitialUpdate()
{
	CEditView::OnInitialUpdate();

	// TODO: Add your specialized code here and/or call the base class
	CEdit& edit = GetEditCtrl();
	CLogger::GetInstance( LOG )->AddAdapter( new CWindowAdapter( edit.GetSafeHwnd() ), true );
}

void CLogView::OnFinalRelease()
{
	// TODO: Add your specialized code here and/or call the base class
	CEditView::OnFinalRelease();
}

void CLogView::OnDestroy()
{
	CEditView::OnDestroy();

	// TODO: Add your message handler code here
	delete CLogger::GetInstance( LOG )->RemoveAdapter( _T("WindowLog") );
}
